import request from '@/utils/request'

// 查询订单管理列表
export function listOrder(query) {
  return request({
    url: '/business/order/list',
    method: 'get',
    params: query
  })
}
// 查询订单管理列表
export function getListOrder(query) {
  return request({
    url: '/business/order/getlist',
    method: 'get',
    params: query
  })
}

// 查询订单管理列表
export function listUserOrder(query) {
  return request({
    url: '/business/order/listUserOrder',
    method: 'get',
    params: query
  })
}
// 查询订单管理列表
export function listUserReceive(query) {
  return request({
    url: '/business/order/listUserReceive',
    method: 'get',
    params: query
  })
}
// 查询我发布的订单管理列表
export function listMyPublishOrder(query) {
  return request({
    url: '/business/order/publishlist',
    method: 'get',
    params: query
  })
}

// 查询我接的订单管理列表
export function listMyReceiveOrder(query) {
  return request({
    url: '/business/order/receivelist',
    method: 'get',
    params: query
  })
}
// 查询异常订单管理列表
export function listExceptionOrder(query) {
  return request({
    url: '/business/order/exceptionOrderList',
    method: 'get',
    params: query
  })
}

// 查询我接的订单管理列表
export function listToReceiveOrder(query) {
  return request({
    url: '/business/order/readyForReceiveList',
    method: 'get',
    params: query
  })
}
// 查询代理下订单管理列表
export function listProxyOrder(query) {
  return request({
    url: '/business/order/proxyOrderList',
    method: 'get',
    params: query
  })
}
// 查询公司下订单管理列表
export function listCompanyOrder(query) {
  return request({
    url: '/business/order/companyOrderList',
    method: 'get',
    params: query
  })
}

// 查询订单管理详细
export function getOrder(id) {
  return request({
    url: '/business/order/' + id,
    method: 'get'
  })
}

// 新增订单管理
export function addOrder(data) {
  return request({
    url: '/business/order',
    method: 'post',
    data: data
  })
}

// 修改订单管理
export function updateOrder(data) {
  return request({
    url: '/business/order',
    method: 'put',
    data: data
  })
}
// 开始服务-订单管理
export function startService(data) {
  return request({
    url: '/business/order/startService',
    method: 'put',
    data: data
  })
}
// 完成服务-订单管理
export function finishService(data) {
  return request({
    url: '/business/order/finishService',
    method: 'put',
    data: data
  })
}
// 分派订单管理
export function distributeOrder(data) {
  return request({
    url: '/business/order/distributeOrder',
    method: 'put',
    data: data
  })
}

// 取消订单管理
export function cancelOrder(data) {
  return request({
    url: '/business/order/cancel',
    method: 'post',
    data: data
  })
}

// 直接提交订单
export function directFinish(data) {
  return request({
    url: '/business/order/order/directFinish',
    method: 'post',
    data: data
  })
}

// 删除订单管理
export function delOrder(id) {
  return request({
    url: '/business/order/' + id,
    method: 'delete'
  })
}

// 导出订单管理
export function exportOrder(query) {
  return request({
    url: '/business/order/export',
    method: 'get',
    params: query
  })
}
// 发起支付
export function createPay(query) {
  return request({
    url: '/pay/getQrPay',
    method: 'get',
    params: query
  })
}
